import rxAjax from '@/assets/js/ajax.js';

//印章管理 api接口
export const FormStampApi = {};

FormStampApi.baseUrl= '/api-form/form/core/formStamp';
FormStampApi.exportUrl= FormStampApi.baseUrl + '/listExport';

//查询列表
FormStampApi.query=function (parameter) {
  var url= FormStampApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

/**
* 获取单记录
* @param pkId
* @returns {*}
*/
FormStampApi.get =function(pkId) {
  var url= FormStampApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

//保存数据
FormStampApi.save =function(parameter) {
  var url= FormStampApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

//删除数据
FormStampApi.del =function(parameter) {
  var url= FormStampApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

//查询列表
FormStampApi.getStamps=function (parameter) {
    var url ="/api-form/form/core/formStamp/getAll";
    return rxAjax.get(url);
}

//保存pdf位置
FormStampApi.savePdfPositions=function (parameter) {
    var url ="/api-form/form/core/formPdfPositions/savePdfPositions";
    return rxAjax.postJson(url,parameter);
}

/**
 * 获取文件盖章位置
 * @param fileId
 * @returns {*}
 */
FormStampApi.getPdfPositions=function (fileId) {
    var url ="/api-form/form/core/formPdfPositions/getPdfPositions?fileId="+fileId;
    return rxAjax.get(url);
}

export  default FormStampApi;

